#include <stdio.h>
#include <string.h>

int main() {
    char str1[21], str2[21], str3[21]; 
    char *p1, *p2, *p3;  

    scanf("%s", str1);
    scanf("%s", str2);
    scanf("%s", str3);

    p1 = str1;
    p2 = str2;
    p3 = str3;
    if (strcmp(p1, p2) > 0) {  
        char *temp = p1;
        p1 = p2;
        p2 = temp;
    }
    if (strcmp(p2, p3) > 0) {  
        char *temp = p2;
        p2 = p3;
        p3 = temp;
    }
    if (strcmp(p1, p2) > 0) { 
        char *temp = p1;
        p1 = p2;
        p2 = temp;
    }
    printf("%s\n", p1);
    printf("%s\n", p2);
    printf("%s\n", p3);

    return 0;
}
